Release 10.1A: OpenEdge Development:
Progress Dynamics Getting Started
Adding a dynamic Lookup to a viewer
A dynamic Lookup can represent a larger set of records than you can display in a dynamic Combo. In this exercise, you add a dynamic Lookup object to the dynamic viewer for the Order table. The dynamic Lookup launches a separate dynamic browse of Customer records. Using the dynamic Lookup, you can assign a customer to the selected Order.
Laying out the Order viewer
![]()
To add the dynamic Combo to the Order viewer:
- Choose File
Open Object in the AppBuilder main window.
- Select the dynamic Viewer, artorviewv, then choose Open.
- Rearrange the fields in the design window. Lay out the fields any way you like, but leave some room to the right of the object fields, as shown:
![]()
- Right-click on the SmartDataField icon
on the Object Palette and select DynamicCombo.
- Click on the Sales Rep field to replace it with the dynamic Combo object. The Choose Existing SmartDataField dialog box appears.
- Double-click SalesrepCombo on the Details tab. The SmartDataField Maintenance dialog box displays the properties for this new instance of the Sales Rep combo.
- Choose Save and exit the dialog box.
You have just reused the dynamic Combo that you created in the "Adding a dynamic Combo to your viewer" section.
Adding a Customer dynamic Lookup
![]()
To add a dynamic Lookup for customers to the viewer:
- Right-click on the SmartDataField icon
on the Object Palette and select DynamicLookup.
- Click on the Customer field in the viewer to replace it with the dynamicLookup object. After the AppBuilder automatically sets up the proper connections, the Choose Existing SmartDataField dialog box appears:
![]()
- Choose the Create New SDF button. The SmartDataField Maintenance dialog box appears:
![]()
- Type CustomerCodeLookup in the SmartDataField field and Customer code dynamic lookup in the Description field.
- Select ds-Entity for the Product module.
- Select the Use cache toggle box.
- Type the following query in the Specify base query string editor:
Since this Lookup will not update the table, the query should include the
NO-LOCKkeyword. The use of theINDEXED-REPOSITIONkeyword is recommended for data access in a stateless environment.- Choose the Refresh button. The remaining area of the property sheet is filled in with default choices for the
arm_customertable, as shown:
![]()
- On the Details tab, select arm_customer.customer_obj in the Key field combo.
- Select arm_customer.customer_name in the Displayed field combo. This is the field whose value shows in the dynamic Lookup.
- Type Customer for the Field label.
- Select the following fields in the browse and set their Display Sequences as listed. These fields will display in the Customer browse that the dynamic Lookup launches:
You can sort on a browse column by clicking on the column header. This screen shot shows the browser sorted by the Browse Sequence column after assigning the sequence values:
![]()
- Select arm_customer.customer_balance in the browse.
In addition to showing fields in the Lookup browse window, you can display one or more fields of the related table on the viewer. You will add a field that displays the customer’s balance.
- Type YES in the Link field column.
Normally, you also map each Link Field to a local variable in the viewer where the field’s value displays.
- Type fiCustomerBalance, the field you will define to display the customer’s balance, in the Linked widget column, as shown:
Note: The fi prefix is a naming convention for a fill-in.
![]()
- Choose the Other tab.
- Type armcufullo for the Maintenance SDO and oeCustFoldWin for the Maintenance object. You will build a browse window called oeCustFoldWin in the "Creating folder windows" section. Since it does not exist in the Repository yet, you cannot use the lookup and must be careful to spell the name correctly, as shown:
Note: There is a useful shortcut for filling in many Lookup fields. If you type a few letters in the field and press the TAB key, the framework automatically searches for matching records. If only one match exists, the framework populates the field with that value. If there are more matches, the framework launches a dialog box filtered to display the matches.
![]()
- Choose Save and exit the maintenance dialog box.
- Select the Fill In
from the Object Palette. This is the local field for the Linked Widget your defined for your Lookup.
- Drop the fill-in onto the design window next to the binoculars icon representing the dynamic Lookup, as shown:
![]()
- Type fiCustomerBalance for the Object and Balance for the Label in the AppBuilder main window, as shown:
![]()
The dynamic Lookup makes the correct association with the Linked Widget name you specified when you defined your lookup and displays the
customer_balancefield in this position.- Double-click the field to bring up its property sheet. Users should not edit the contents of this field, so you must disable it.
- Unselect the Enable toggle box, as shown:
![]()
- Choose OK. Your Order viewer should now look something like the following:
![]()
- Choose Save.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |